/*
 * @lc app=leetcode.cn id=2 lang=javascript
 *
 * [2] 两数相加
 */

// @lc code=start
/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */


/**
 * @param {ListNode} l1
 * @param {ListNode} l2
 * @return {ListNode}
 */
var addTwoNumbers = function(l1, l2) {
    let count = 0;
    let sum1 = 0;
    const loop = (l) => {
        console.log(l)
        sum1 += l.val * Number(`1e${count}`)
        count++;
        if (l.next) {
            loop(l.next);
        }
        return 
    }
    loop(l1.val)
    console.log(sum1)
};

addTwoNumbers([2,4,3],[5,6,4])
// @lc code=end

